Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for exclude markers. #35

Merged
merged 2 commits into from
Jan 21, 2020
Merged

Add support for exclude markers. #35

merged 2 commits into from
Jan 21, 2020

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jan 21, 2020

This PR adds support for three simple source markers that remove coverage: COV_EXCL_LINE to exclude a single line, and COV_EXCL_START to COV_EXCL_STOP to define respectively the start and end of a section of code that should be excluded. These mimic (and are compatible with) similar markers as found in lcov and gcov: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php

The changes are based on JuliaCI/Coverage.jl#218, but I left out support for excluding files (and the ability to configure using a .coverage.yml) because that is covered by existing tools already: Codecov.io supports an ignore list in its .codecov.yml, and LCOV tracefiles can be pruned with lcov --remove. We can always add that functionality later on, but this seems like a straightforward first step.

@maleadt maleadt force-pushed the tb/exclude_markers branch from 15c8892 to e673af6 Compare January 21, 2020 13:11
@codecov-io
Copy link

codecov-io commented Jan 21, 2020

Codecov Report

Merging #35 into master will increase coverage by 1.6%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #35     +/-   ##
=========================================
+ Coverage   94.81%   96.41%   +1.6%     
=========================================
  Files           4        4             
  Lines         212      223     +11     
=========================================
+ Hits          201      215     +14     
+ Misses         11        8      -3
Impacted Files Coverage Δ
src/CoverageTools.jl 98.27% <100%> (+0.14%) ⬆️
src/parser.jl 82.75% <0%> (+3.44%) ⬆️
src/lcov.jl 100% <0%> (+3.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39b02b0...3784ac2. Read the comment docs.

@maleadt maleadt force-pushed the tb/exclude_markers branch from e673af6 to 13bc1dd Compare January 21, 2020 13:20
@maleadt
Copy link
Member Author

maleadt commented Jan 21, 2020

Not sure why 1.0 yields completely different coverage results here; the other tests behave like that...

@maleadt maleadt requested a review from vtjnash January 21, 2020 15:07
src/CoverageTools.jl Outdated Show resolved Hide resolved
@maleadt maleadt force-pushed the tb/exclude_markers branch from f5b9839 to 5ee56e3 Compare January 21, 2020 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants